﻿using PowerBooking.RSE.Poco;
using PowerBooking.RSE.Repository;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;

namespace PowerBooking.RSE.Domain.Models
{
    /// <summary>
    /// 城市实体
    /// </summary>
    public class City
    {
        /// <summary>
        /// 城市ID
        /// </summary>
        public int CityID { get { return cityPoco.CityID; } }

        /// <summary>
        /// 城市名称
        /// </summary>
        public string Name { get { return cityPoco.Name; } }

        /// <summary>
        /// 城市Url
        /// </summary>
        public string Url { get { return cityPoco.Url; } }

        /// <summary>
        /// 筛选项集合
        /// </summary>
        public List<Filter> Filters { get; private set; }

        /// <summary>
        /// 餐厅集合
        /// </summary>
        public List<Restaurant> Restaurants { get; private set; }

        private CityPoco cityPoco;

        /// <summary>
        /// 初始化领域对象
        /// </summary>
        /// <returns></returns>
        internal City InitDomain(CityPoco cityPoco)
        {
            this.cityPoco = cityPoco;
            return this;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="filters"></param>
        /// <param name="restaurants"></param>
        /// <returns></returns>
        internal City InitFilters(List<Filter> filters)
        {
            Filters = filters;
            return this;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="filters"></param>
        /// <param name="restaurants"></param>
        /// <returns></returns>
        internal City InitRestaurants(List<Restaurant> restaurants)
        {
            Restaurants = restaurants;
            return this;
        }
    }
}
